package com.exam.demo.util;

import com.exam.demo.entity.Question;

import java.util.ArrayList;

/**
 * 功能描述
 *
 * @author yxj30
 * @date 2022/04/26  0:14
 */
public class UtilTest {
    public static void print(ArrayList<ArrayList<Question>> population) {
        //打印
        System.out.println("打印种群");
        for (int i = 0; i < population.size(); i++) {
            System.out.println("第"+(i+1)+"个体(从1开始）");
            printIndividual(population.get(i));
            System.out.println();
        }


    }
    public static void printIndividual(ArrayList<Question> list){

        for (int i = 0; i <list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
    //打印适应度
    public static void printFitness(ArrayList<Double> list){
        System.out.println("打印适应度");
        for (int i = 0; i < list.size(); i++) {
            System.out.print((i+1)+":"+list.get(i)+"  ");
        }
        System.out.println();
    }
}
